﻿using sql_data_generator.FieldOptions;
using sql_data_generator.Generators;
using sql_data_generator.TextData;

namespace sql_data_generator.Randomizers
{
    class RandomizerLastName : BaseRandomizer<FieldOptionsLastName>, IRandomizer
    {
        private readonly RandomStringFromListGenerator _lastNamesGenerator;

        public RandomizerLastName(FieldOptionsLastName options)
            : base(options)
        {
            _lastNamesGenerator = new RandomStringFromListGenerator(Texts.Instance.LastNames);
        }

        public object GetData()
        {
            return IsNull() ? null : _lastNamesGenerator.Generate();
        }
    }
}